//
//  ViewController.m
//  LBHitTestDemo
//
//  Created by mac on 2024/6/2.
//

#import "ViewController.h"
#import "LBHittestButton.h"

@interface ViewController ()

@property (nonatomic, strong) LBHittestButton *button;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.button];
    self.view.backgroundColor = [UIColor whiteColor];
    // Do any additional setup after loading the view.
}

- (void)buttonClick
{
    NSLog(@"哈哈哈大按钮点击了");
}

#pragma mark - lazy load

- (LBHittestButton *)button
{
    if (!_button) {
        _button = [LBHittestButton buttonWithType:UIButtonTypeCustom];
        _button.frame = CGRectMake(100, 100, 100, 100);
        _button.expandEdgeInsets = UIEdgeInsetsMake(-40, -40, -40, -40);
        _button.backgroundColor = [UIColor cyanColor];
        [_button addTarget:self action:@selector(buttonClick) forControlEvents:UIControlEventTouchUpInside];
    }
    return _button;
}

@end
